package com.myblog.demo.mapper;

import com.myblog.demo.entity.vo.Following;
import com.myblog.demo.entity.vo.Follows;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 关注关系的 Mapper
 */
@Mapper
public interface FollowMapper {
    // userId 关注 followingId
    int addFollowRelationship(@Param("userId") Integer userId, @Param("followingId") Integer followingId);

    // 查找 userId 是否关注了 followingId
    Integer findFollowRelationship(@Param("userId") Integer userId, @Param("followingId") Integer followingId);

    // userId 取消关注 followingId
    int delFollowRelationship(@Param("userId") Integer userId, @Param("followingId") Integer followingId);

    // 获取 userId 关注的作者列表
    List<Following> getFollowingList(@Param("userId") Integer userId);

    // 获取 userId 的粉丝列表
    List<Follows> getFollowsList(@Param("userId") Integer userId);

}
